<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
<script>
    var time = parseInt(  window.prompt("请输入你的时间") );
    if(time<12&&time>6){
       alert("上午")
    }
    else if(time<18&&time>13)
    {
        alert("下午")

    }
    else if(time<23&&time>19)
    {
        alert("晚上")

    }
    else if(time<5&&time>0)
    {
        alert("休息")

    }
</script>
</body>
</html>